﻿using PLC.Application.BaseMenus.Services;
using PLC.Interface.BaseMenus;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using YWM;
using YWM.Dto;

namespace PLC.Application.BaseMenus
{
    public class BaseMenuAppService : IBaseMenuAppService
    {
        private readonly IBaseMenuService _baseMenuService = YApp.Resolve<IBaseMenuService>();

        public async Task<List<BaseMenuResultDto>> GetTopList(int top = 6)
        {
            PagedResultDto<BaseMenuResultDto> pagedResultDto = await _baseMenuService.GetAll(new BaseMenuResultRequestDto { MaxResultCount = top, IsActive = true, Sorting = "Sort" });
            return pagedResultDto.Items.ToList();
        }
    }
}
